package org.liu.async;

import org.liu.async.kit.AsyncConfig;
import org.liu.async.kit.DynamicProxy;

import java.util.concurrent.TimeUnit;

/**
 * Created by liuj on 2015/12/13.
 * 动态生成代理类对象JobMan
 */
public class Test {

    public static void main(String[] args) throws InterruptedException, ClassNotFoundException {
        Class<?> targetClass = Class.forName("org.liu.async.JobMan");
        JobMan jobMan = (JobMan) DynamicProxy.getProxy(targetClass, new AsyncConfig(3000, TimeUnit.MILLISECONDS));
        JobResult jobResult = jobMan.doJob();
        System.out.println("do some other things");
        jobResult.printResult();
        Thread.sleep(1000);
    }

}
